import { Message } from "node-nats-streaming";
import { Listener } from "./base-listener";
import { TicketCreatedEvent } from "./ticket-created-event";
import { Subjects } from "./subjects";

export class TicketCreatedListener extends Listener<TicketCreatedEvent>{
        readonly subject: Subjects.TicketCreated = Subjects.TicketCreated;
        queueGroupName = "payments-service";

        onMessage(data: TicketCreatedEvent["data"], msg:Message) {
                console.log(`事件数据`, data);
                msg.ack();
        }
}
